<?php
ob_start();
require_once '../sub/init.php';
require_once 'chkUadm.php';
require_once ZEAI.'cache/udata.php';
require_once ZEAI.'sub/zeai_up_func.php';
if(!in_array('315',$QXARR))exit(noauth());
$nav='index';
require_once ZEAI.'m/div_left_so.php';?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $_ADM['admSiteName']; ?></title>
<?php echo HEADMETA; ?>
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<?php require_once 'm_style.php';?>
<link href="css/m_adm.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<style>
.ulist{margin:70px auto 100px auto}
.ulist li{width:92%;margin:0 auto 20px auto;border-radius:8px;background-color:#fff;box-shadow:0 0 24px rgb(0 0 0 / 8%);position:relative;}
.ulist li .uidbox{padding:0 10px;margin:0 auto;line-height:40px;color:#999;border-bottom:#f5f5f5 1px solid;text-align:left}
.ulist li .flagbox,.ulist li .flagboxed{width:80px;position:absolute;line-height:12px;top:14px;right:10px;text-align:right}
.ulist li .flagbox i,.ulist li .flagboxed i{font-size:12px;color:#f00}
.ulist li .flagboxed i,.ulist li .flagboxed{color:#45c01a;}
.ulist li .uinfo{padding:0 15px;text-align:left;position:relative;min-height:112px}
.ulist li .uinfo img.photo_s,.ulist li .uinfo img.photo_s2{width:50px;height:50px;object-fit:cover;-webkit-object-fit:cover;position:absolute;border-radius:50%;top:15px}
.ulist li .uinfo img.photo_s2{left:50px;}
.ulist li .uinfo img.photo_s{left:170px;}
.ulist li .uinfo .uid,.ulist li .uinfo .uid2{width:90px;position:absolute;top:68px;font-size:12px;text-align:center;color:#999}
.ulist li .uinfo .uid span,.ulist li .uinfo .uid2 span{display:inline-block}
.ulist li .uinfo .uid2{left:30px;}
.ulist li .uinfo .uid{left:150px;}
.ulist li .uinfo .jt{position:absolute;left:120px;top:30px;text-align:center;font-size:18px;width:30px;color:#bbb}
.ulist li .uinfo .btn{position:absolute;right:12px}
.ulist li .uinfo .yes{top:68px;background-color:<?php echo $_ADM['color'];?>}
.ulist li .datali{padding:10px;line-height:25px;border-top:#f5f5f5 1px solid;text-align:left;font-size:12px;position:relative}
.ulist li .datali span{display:inline-block;padding:5px;margin:5px 4px;border-radius:3px;box-shadow:0 0 4px rgb(0 0 0 / 9%);max-width:94%;word-wrap:break-word;color:#999}
.ulist li .datali span.pic{text-align:center}
.ulist li .datali span.pic img{width:30px;height:30px;object-fit:cover;-webkit-object-fit:cover}
.ulist li .datali .chkbox{position:absolute;right:10px;bottom:10px}
.ulist li .flag1_str{position:absolute;right:0px;top:38px;z-index:1}
</style>
</head>
<body>
<?php
$SQL = "";
$Skey = trimm($Skey);
if (ifint($Skey)){
	$SQL = " AND (b.id=$Skey) ";
}elseif(!empty($Skey)){
	$SQL = " AND ( ( b.uname LIKE '%".$Skey."%' ) OR ( b.nickname LIKE '%".$Skey."%' ) OR ( b.nickname LIKE '%".urlencode($Skey)."%' ) )";
}
if(!empty($Skey2)){
	$SQL = " AND ( a.content LIKE '%".$Skey2."%' )";
}
switch ($sort) {
	default:$SORT = " ORDER BY flag,id DESC ";break;
}
if ($f=='f0')$SQL .= " AND a.flag=0";
if ($f=='f1')$SQL .= " AND a.flag=1";
//
$rtt = $db->query("SELECT COUNT(*) FROM ".__TBL_315__." a ,".__TBL_USER__." b WHERE a.uid=b.id ".$SQL);
$roww = $db->fetch_array($rtt);
//
$mini_title='举报管理（'.$roww[0].'）';$mini_class='top_mini4 ';
$mini_L = '<em onClick="zeai.openurl(\'m_adm.php\')"><i class="ico" >&#xeaca;</i><span></span></em>';
require_once ZEAI.'m/top_mini.php';?>
<a class="so" id="user_search"><i class="ico">&#xe66c;</i><span>筛选</span></a>
<form id="www_zeai_cn_FORM" class="ulist" method="get" action="<?php echo SELF; ?>">
	<?php
	$rt = $db->query("SELECT a.*,b.sex,b.grade,b.nickname FROM ".__TBL_315__." a,".__TBL_USER__." b WHERE a.uid=b.id ".$SQL.$SORT." LIMIT ".$_ADM['admLimit']);
	$total = $db->num_rows($rt);
	if ($total <= 0 ) {
		echo "<div class='nodataico'><i class='ico'>&#xe608;</i>暂无信息<br><br><a class='aBAI' href='javascript:history.back(-1)'>返回上一步</a></div>";
	} else {
		$page_skin=2;$pagemode='mob';$pagesize=8;require_once ZEAI.'sub/page.php';
		for($i=1;$i<=$pagesize;$i++) {
			$rows = $db->fetch_array($rt);if(!$rows) break;
			$id = $rows['id'];$uid = $rows['uid'];
			$uname = strip_tags($rows['uname']);
			$uname = str_replace($Skey,"<font color=red><b>".$Skey."</b></font>",$uname);
			$nickname = trimhtml(dataIO($rows['nickname'],'out'));
			$nickname = str_replace($Skey,"<font color=red><b>".$Skey."</b></font>",$nickname);
			$sex       = $rows['sex'];
			$grade     = $rows['grade'];
			$photo_s   = $rows['photo_s'];
			if(empty($rows['nickname']))$nickname = $uname;
			$content = trimhtml(dataIO($rows['content'],'out'));
			$content = str_replace($Skey2,"<font color=red><b>".$Skey2."</b></font>",$content);
			$addtime = YmdHis($rows['addtime']);
			$path_s  = $rows['picurl'];
			$kind    = $rows['kind'];
			$senduid = $rows['senduid'];
			$flag    = $rows['flag'];
			$photo_s_url = (!empty($photo_s))?UP.smb($photo_s,'s'):RES.'photo_s'.$sex.'.png';
			$row = $db->ROW(__TBL_USER__,"uname,sex,grade,nickname,photo_s","id=".$senduid);
			if ($row){
				$uid2 = $senduid;
				$uname2 = $row['uname'];
				$sex2   = $row['sex'];
				$grade2  = $row['grade'];
				$photo_s2 = $row['photo_s'];
				$nickname2 = dataIO($row['nickname'],'out');
				$photo_s_url2 = (!empty($photo_s))?UP.smb($photo_s,'s'):RES.'photo_s'.$sex.'.png';
			}
			if(!empty($path_s)){
				$path_s_url = UP.$path_s;
			}else{
				$path_s_url = '';
			}?>
            <li id="tr<?php echo $id;?>">
				<div class="uidbox">
                    <div class="C333 S12">举报类型：<?php echo $kind; ?></div>
                    <div class="<?php echo ($flag == 1)?'flagboxed':'flagbox';?>">
						<?php
						if ($flag == 1){
                            $icoo="<i class='ico'>&#xe67f; 已处理</i>";
							$flag_str = '<img src="images/flag_ycl.png" width="70" height="70">';
                        } else {
                            $icoo="<i class='ico'>&#xe65b; 未处理</i>";
							$flag_str = '<img src="images/flag_ddcl.png" width="70" height="70">';
                        }
                        echo $icoo;
                        ?>
                    </div>
                    <div class="clear"></div>
				</div>
                <div class="flag1_str"><?php echo $flag_str;?></div>
				<div class="uinfo">
					<a href="javascript:ZeaiM.piczoom('<?php echo smb($photo_s_url2,'b');?>');"><img class="photo_s2" src="<?php echo $photo_s_url2;?>"></a>
                    <div class="uid2"><span><?php echo $uid2;?></span><br><?php echo uicon($sex2.$grade2);?><?php echo $nickname2;?></div>
                    
                    <a href="javascript:ZeaiM.piczoom('<?php echo smb($photo_s_url,'b');?>');"><img class="photo_s" src="<?php echo $photo_s_url;?>"></a>
                    <div class="uid"><span><?php echo $uid;?></span><br><?php echo uicon($sex.$grade);?><?php echo $nickname;?></div>
					<i class="ico jt">&#xe62d;</i>
                    
                    <?php if ($flag == 0){?><a href="javascript:;" class="btn size2 yes flag1" value="<?php echo $id; ?>">处理</a><?php }?>
				</div>
				<div class="datali">
                	举报时间：<?php echo $addtime;?>
                	<?php if (!empty($content))echo '<br>举报内容：'.$content;?>
                    <?php if (!empty($path_s)){?>
                    <br><span class="pic" onClick="ZeaiM.piczoom('<?php echo $path_s_url; ?>');"><img src="<?php echo $path_s_url; ?>"><br>举证图片</span>
                    <?php }?>
                    <div class="chkbox">
                    <input type="checkbox" name="list[]" value="<?php echo $id; ?>" uid="<?php echo $uid; ?>" id="id<?php echo $id; ?>" class="checkskin"><label for="id<?php echo $id; ?>" class="checkskin-label"><i class="i1"></i></label>
                    </div>
                    <div class="clear"></div>
                </div>
			</li>
			<?php
		}
	}
	?>
</form>
<script>var bg = '<?php echo $_Style['list_bg']; ?>',overbg   = '<?php echo $_Style['list_overbg']; ?>',selectbg = '<?php echo $_Style['list_selectbg']; ?>';</script>
<!--div_left_so-->
<div id="rangebox"></div>
<div class="div_left_so" id="user_so">
	<form action="<?php echo SELF;?>" method="get" name="www.yzlove.com" id="ZEAI_CN_FORM_ext">
    	<div class="form_uid">
        <input name="Skey" type="text" class="input" id="Skey" maxlength="20" value="<?php echo $Skey;?>" placeholder="被举报人UID/用户名/昵称" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
    	<div class="form_uid">
        <input name="Skey2" type="text" class="input" id="Skey2" maxlength="20" value="<?php echo $Skey2;?>" placeholder="按举报内容" autocomplete="off">
        <button type="submit" class="ico">&#xe6c4;</button>
		</div>
        <?php
		div_left_so_out(array('tbody'=>'处理状态','t'=>'f','tv'=>$f,'subkind'=>2,'newarr'=>json_decode('[{"i":"f0","v":"未处理"},{"i":"f1","v":"已处理"}]'),'ulcls'=>' col3'));
		?>
        <script>div_left_so_init('user_so')</script>
        <div class="savebox"><button type="button" class="btn size3 reset" onClick="div_left_so_reset('user_so')">重置</button><button type="submit" class="btn size3 zeaibg ico">&#xe6c4; 确定</button></div>
    </form>
</div>
<script>user_search.onclick=function(){ZeaiM.div_left({obj:user_so,w:28});}</script>
<!--div_left_so end-->

<?php if ($total > 0 ) {?>
<div id="backtop"><a id="btmTopBtn"><i class="ico">&#xe60c;</i>顶部</a></div>
<?php echo $page_cls;?>
<div class="listbottombox">
	<input type="checkbox" id="checkboxall2" class="checkskin checkboxall"><label for="checkboxall2" class="checkskin-label"><i class="i1"></i></label>　
    <button type="button" id="btndellist" class="btn size2 HEI2 disabled action">删除</button>
	<?php if ($total > $pagesize)echo '<div class="pagebox">'.$pagelist.'</div>'; ?>
</div>
<script>
o('btndellist').onclick = function() {
	allList({
		btnobj:this,
		url:'315'+zeai.ajxext+'submitok=alldel',
		title:'批量删除',
		msg:'正在删除中...',
		ifjson:true,
		ifconfirm:true
	});	
}
zeai.listEach('.flag1',function(obj){
	obj.onclick = function(){
		zeai.confirm('确定处理完成了么？',function(){
			var id = parseInt(obj.getAttribute("value"));
			zeai.ajax({url:'315'+zeai.extname,data:{submitok:'ajax_flag',id:id}},function(e){var rs=zeai.jsoneval(e);
				zeai.msg(0);zeai.msg(rs.msg);
				if(rs.flag==1){setTimeout(function(){location.reload(true);},1000);}
			});
		});
	}
});
</script>
<script src="js/zeai_tablelist.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<?php }?>
</body></html><?php ob_end_flush();?>